import http from '@http'
import config from '@config'

class HomeService {

  //左侧菜单
  async indexa(params={}) {
    return await http.get(
      config.ApiUrl.indexa,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //角色列表
  async roleLists(params) {
    return await http.post(
      config.ApiUrl.roleLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //管理员添加
  async aduserAdd(params) {
    return await http.post(
      config.ApiUrl.aduserAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //角色详情
  async roleShow(params) {
    return await http.get(
      config.ApiUrl.roleShow,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //创建角色
  async roleAdd(params) {
    return await http.get(
      config.ApiUrl.roleAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //权限分配树
  async mensLists(params) {
    return await http.get(
      config.ApiUrl.mensLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //管理员列表
  async adminLists(params) {
    return await http.post(
      config.ApiUrl.adminLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //管理员编辑
  async adminEdit(params) {
    return await http.post(
      config.ApiUrl.adminEdit,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //管理员删除
  async admindelete(params) {
    return await http.post(
      config.ApiUrl.admindelete,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }


  //分配权限
  async roleAccess(params) {
    return await http.post(
      config.ApiUrl.roleAccess,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //删除角色
  async roleDelete(params) {
    return await http.post(
      config.ApiUrl.roleDelete,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //扶贫档案列表
  async archiveLists(params) {
    return await http.post(
      config.ApiUrl.archiveLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //扶贫档案删除
  async archiveDel(params) {
    return await http.post(
      config.ApiUrl.archiveDel,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //教师添加
  async teacherAdd(params) {
    return await http.post(
      config.ApiUrl.teacherAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //教师编辑
  async teacherUpdate(params) {
    return await http.post(
      config.ApiUrl.teacherUpdate,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //教师删除
  async teacherDel(params) {
    return await http.post(
      config.ApiUrl.teacherDel,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //扶贫档案人员添加
  async archiveAdd(params) {
    return await http.post(
      config.ApiUrl.archiveAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //扶贫档案人员编辑archiveUpdate
  async archiveUpdate(params) {
    return await http.post(
      config.ApiUrl.archiveUpdate,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //学员列表
  async traineeLists(params){
    return await http.post(
      config.ApiUrl.traineeLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //添加学员
  async traineeAdd(params ={}){
    return await http.post(
      config.ApiUrl.traineeAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //编辑学员
  async traineeUpdate(params ={}){
    return await http.post(
      config.ApiUrl.traineeUpdate,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //删除学员
  async traineeDelet(params ={}){
    return await http.post(
      config.ApiUrl.traineeDelet,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //学员身份证照片
  async baseUpload(params ={}){
    return await http.post(
      config.ApiUrl.baseUpload,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //班级列表
  async classList(params){
    return await http.post(
      config.ApiUrl.classList,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //添加班级
  async addClass(params){
    return await http.post(
      config.ApiUrl.addClass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //教师列表
  async teacherLists(params ={}){
    return await http.post(
      config.ApiUrl.teacherLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //编辑班级
  async editClass(params){
    return await http.post(
      config.ApiUrl.editClass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      } 
    )
  }

  //删除班级
  async delClass(params ={}){
    return await http.post(
      config.ApiUrl.delClass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //结班
  async lockClass(params ={}){
    return await http.post(
      config.ApiUrl.lockClass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //课程列表
  async courseLists(params ={}){
    return await http.post(
      config.ApiUrl.courseLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //课程列表
  async courseShow(params ={}){
    return await http.post(
      config.ApiUrl.courseShow,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //课程添加
  async courseAdd(params ={}){
    return await http.post(
      config.ApiUrl.courseAdd,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //上传证书
  async datumLoad(params ={}){
    return await http.post(
      config.ApiUrl.datumLoad,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //项目主任列表
  async projectMan(params ={}){
    return await http.post(
      config.ApiUrl.projectMan,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  

  //是否结清
  async whetherMoney(params){
    return await http.post(
      config.ApiUrl.whetherMoney,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //未分配的录入员
  async enterMan(params ={}){
    return await http.post(
      config.ApiUrl.enterMan,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  
  //分配的录入员
  async toMan(params ={}){
    return await http.post(
      config.ApiUrl.toMan,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  
  //获取未分配班级的录入员
  async tobindclass(params ={}){
    return await http.post(
      config.ApiUrl.tobindclass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  
  //绑定班级到录入员
  async bindluruclass(params ={}){
    return await http.post(
      config.ApiUrl.bindluruclass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //删除待审核列表
  async waitDelTrainee(params){
    return await http.post(
      config.ApiUrl.waitDelTrainee,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //录入员列表
  async enterLists(params){
    return await http.post(
      config.ApiUrl.enterLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //学员编辑待审核列表
  async waitToTrainee(params ={}){
    return await http.post(
      config.ApiUrl.waitToTrainee,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //项目主任同意删除
  async delTrainee(params ={}){
    return await http.post(
      config.ApiUrl.delTrainee,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //项目主任同意编辑
  async upTrainee(params ={}){
    return await http.post(
      config.ApiUrl.upTrainee,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //学员修改待确认
  async updateTrainee(params ={}){
    return await http.post(
      config.ApiUrl.updateTrainee,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //数据库备份
  async dataBase(params ={}){
    return await http.get(
      config.ApiUrl.dataBase,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //数据库列表
  async dataLists(params ={}){
    return await http.get(
      config.ApiUrl.dataLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //数据库列表
  async authLogin(params ={}){
    return await http.post(
      config.ApiUrl.authLogin,
      params
    )
  }
  
  //数据库列表
  async pxLists(params ={}){
    return await http.post(
      config.ApiUrl.pxLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //图片上传
  async uploadUP(params ={}){
    return await http.post(
      config.ApiUrl.uploadUP,
      params,
      // {
      //   token:localStorage.getItem("token").replace(/\"/g,"")
      // }
    )
  }
  
  //图片上传
  async Logs(params ={}){
    return await http.post(
      config.ApiUrl.Logs,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //排行榜
  async topSort(params ={}){
    return await http.post(
      config.ApiUrl.topSort,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //人员统计
  async manLine(params ={}){
    return await http.post(
      config.ApiUrl.manLine,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }

  //获取未结班的班级情况
  async endClass(params ={}){
    return await http.post(
      config.ApiUrl.endClass,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //获取未结班的班级情况
  async checkArchive(params ={}){
    return await http.post(
      config.ApiUrl.checkArchive,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //获取年龄
  async traineeAge(params ={}){
    return await http.post(
      config.ApiUrl.traineeAge,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //获取年龄
  async get_classLists(params ={}){
    return await http.post(
      config.ApiUrl.get_classLists,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  //获取年龄
  async aaaaa(params ={}){
    return await http.post(
      config.ApiUrl.aaaaa,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //图片批量保存
  async down_all(params ={}){
    return await http.post(
      config.ApiUrl.down_all,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //图片批量保存
  async up_new(params ={}){
    return await http.post(
      config.ApiUrl.up_new,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //图片批量保存
  async bsupnew(params ={}){
    return await http.post(
      config.ApiUrl.bsupnew,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //导入表格
  async loadfile(params ={}){
    return await http.post(
      config.ApiUrl.loadfile,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //录入员
  async user_show(params ={}){
    return await http.post(
      config.ApiUrl.user_show,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  
  //录入员
  async lly_edit(params ={}){
    return await http.post(
      config.ApiUrl.lly_edit,
      params,
      {
        token:localStorage.getItem("token").replace(/\"/g,"")
      }
    )
  }
  // //图片批量保存
  // async aa(params ={}){
  //   return await http.post(
  //     config.ApiUrl.aa,
  //     params,
  //     {
  //       // token:localStorage.getItem("token").replace(/\"/g,"")
  //        "Content-Type": "application/x-www-form-urlencoded",
  //     }
  //   )
  // }

}

export default new HomeService()